{include file="public/header"/}
<script src="{__PUBLIC_PATH}/common/js/jquery.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/admin/pcf/update.js?v={$version}"></script>
<style>
/** 统计快捷方式样式 */
.console-link-block{display:block;position:relative;color:#fff;font-size:18px;padding:25px 20px;border-radius:4px;overflow:hidden;box-shadow:0px 3px 5px rgba(0,0,0,.1);background-color:rgb(155,197,57);}
.console-link-block .console-link-block-num{font-size:40px;font-weight:bold;margin-bottom:10px;}
.console-link-block .console-link-block-icon{height:70px;position:absolute;right:20px;top:50%;transform:translateY(-50%);}
.console-link-block .console-link-block-band{background-color:rgb(227,42,22);font-size:14px;position:absolute;width:80px;padding:0px 0;text-align:center;transform:rotate(45deg);right:-21px;top:8px;color:rgba(255,255,255,.9);z-index:1;}
 /** 小屏幕下样式 */
@media screen and (max-width:992px){
.console-link-block{font-size:14px;padding:15px 10px;}
.console-link-block .console-link-block-num{font-size:28px;margin-bottom:0px;}
.console-link-block .console-link-block-icon{height:45px;right:10px;}
.console-link-block .console-link-block-band{font-size:12px;right:-25px;top:8px;}
}
/** 设置每个快捷块的颜色 */
#consoleLink > div:first-child .console-link-block{background-color:rgb(155,197,57);}
#consoleLink > div:nth-child(2) .console-link-block{background-color:rgb(85,165,234);}
#consoleLink > div:nth-child(3) .console-link-block{background-color:rgb(157,175,291);}
#consoleLink > div:nth-child(4) .console-link-block{background-color:rgb(245,145,162);}
#consoleLink > div:nth-child(5) .console-link-block{background-color:rgb(254,170,79);}
#consoleLink > div:last-child .console-link-block{background-color:rgb(64,212,176);}
.console-menu li .layui-icon{display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
.console-menu li cite{position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
.pcfnote{background:#fff;margin-bottom:15px;box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);}
</style>
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid">

   {if($is_gzpcf_authortoken < 0)}
   <blockquote class="layui-elem-quote pcfnote">欢迎加入PCFCMS大家庭，<a target="_blank" href="https://shang.qq.com/wpa/qunwpa?idkey=961b6839e392f1cb4f25c32af12fdc861bca830e89649b2fcb6ec32ba32c6550" style="color:#FF5722;">587884271</a>，PS：正式版本没有这个div哈，这里主要是便于用户加群。</blockquote>
   {/if}

    <!-- 快捷方式 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-card">
              <div class="layui-card-header">快捷导航</div>
              <div class="layui-card-body">
                <div class="console-menu">
                   <ul class="layui-row layui-col-space10">
                    {volist name='$quickMenu' id='vo' length='11'}
                      <li class="layui-col-xs3 layui-col-md2" style="padding:12px;">
                      {if($vo.issystem == 1)}
                        <a ew-href="{:url('/system.'.$vo.controller.'/'.$vo.action)}" ew-title="{$vo.laytext}" target="_self">
                          <i class="layui-icon"><cite>{$vo.title}</cite></i>
                        </a>
                      {elseif ($vo.issystem == 2)/}
                        <a ew-href="{:url('/'.$vo.controller.'/'.$vo.action)}" ew-title="{$vo.laytext}" target="_self">
                          <i class="layui-icon"><cite>{$vo.title}</cite></i>
                        </a>
                      {else/}
                        <a ew-href="{:url('/channel.'.$vo.controller.'/'.$vo.action)}" ew-title="{$vo.laytext}" target="_self">
                          <i class="layui-icon"><cite>{$vo.title}</cite></i>
                        </a>
                      {/if}                        
                      </li>
                    {/volist}
                    <li class="layui-col-xs3 layui-col-md2" style="padding:12px;">
                        <a href="javascript:void(0);" id="quickMenuAdd">
                          <cite><i style="font-size:30px" class="layui-icon layui-icon-add-1"></i></cite>
                        </a>
                      </li>
                    </ul>
                 </div> 
              </div>
            </div>
        </div>
      <div class="layui-col-md4">
        <div class="layui-card">
          <div class="layui-card-header">版本信息</div>
          <div class="layui-card-body layui-text">
            <table class="layui-table mt8 mb8">
              <colgroup>
                <col width="100">
                <col>
              </colgroup>
              <tbody>
                <tr>
                  <td>系统更新</td>
                  <td id="td_upgrade_msg">
					  {if $is_gzpcf_authortoken <= 0}
					    授权用户可在线升级
					  {else/}
						<div id="upgrade_filelist" style="display:none;"></div> 
						<div id="upgrade_intro" style="display:none;"></div> 
						<div id="upgrade_notice" style="display:none;"></div> 
						<a href="javascript:void(0);" id="a_upgrade" data-version="" data-max_version="" data-iframe="workspace" title="" data-tips_url="{:url('/update/setPopupUpgrade')}" data-upgrade_url="{:url('/update/upmain')}" data-check_authority="{:url('/update/check_authority')}">正在版本检测中……</a>
					  {/if}
				  </td>
                </tr>
                <tr>
                  <td>当前版本</td>
                  <td>
                    {$sys_info.curent_version|default='v1.0.0'}
                    <a href="http://www.pcfcms.com/article/gengxinrizhi.html" target="_blank" style="padding-left:15px;">更新日志</a>
                 </td>
                </tr>
                <tr>
                  <td>程序名称</td>
                  <td>{$sys_info.web_name|default='PCFCMS系统'}</td>
                </tr>
                <tr>
                  <td>商用许可</td>
                  {if $is_gzpcf_authortoken <=0}
                  <td style="padding-bottom:0;">
                    <div class="layui-btn-container">
                      <a href="http://www.pcfcms.com/zaixiankaitong.html" target="_blank" class="layui-btn layui-btn-danger layui-btn layui-btn-sm">购买授权</a>
                      <a href="javascript:void(0);" id="check_authortoken" class="layui-btn layui-btn layui-btn-sm">立即校验</a>
                    </div>
                  </td>
                  {else /}
                  <td style="padding:12px 15px;">正版软件</td>
                  {/if}
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
    <!-- 服务器信息 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-card">
                <div class="layui-card-header">最近登录 <a ew-href="{:url('/system.adminlog/index')}" ew-title="登陆日志"  style="float:right;">查看更多>></a></div>
                <div class="layui-card-body" style="min-height:450px;">  
                    <table class="layui-table"> 
                    <thead><tr><th>状态</th><th>登录用户</th><th>记录时间</th><th>登录IP</th></tr></thead> 
                    <tbody>
                    {volist name='$adminlog' id='vo' length='11'}
                        <tr><td>{$vo.log_info}</td><td>{$vo.adminname|default='null'}</td>
                        <td>{$vo.log_time}</td><td>{$vo.log_ip}</td></tr>  
                    {/volist}
                    </tbody> 
                    </table>  
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="layui-card">
              <div class="layui-card-header">服务器信息</div>
              <div class="layui-card-body layui-text">
              <table class="layui-table">
                <colgroup><col width="150"><col></colgroup>
                <tbody>
                <tr><td>服务器操作系统：</td><td>{$sys_info.os}</td></tr>
                <tr><td>服务器域名/IP：</td><td>{$sys_info.domain} / [ {$sys_info.ip} ]</td></tr>
                <tr><td>服务器环境：</td><td>{$sys_info.web_server}</td></tr>
                <tr><td>PHP 版本：</td><td>{$sys_info.phpv}</td></tr>
                <tr><td>Mysql 版本：</td><td>{$sys_info.mysql_version}</td></tr>
                <tr><td>GD 版本：</td><td>{$sys_info.gdinfo}</td></tr>
                <tr><td>文件上传限制：</td><td>{$sys_info.fileupload}</td></tr>
                <tr><td>最大占用内存：</td><td>{$sys_info.memory_limit}</td></tr>
                <tr><td>POST限制：</td><td>{$sys_info.postsize|default='unknown'}</td></tr>
                <tr><td>最大执行时间：</td><td>{$sys_info.max_ex_time}</td></tr>
                <tr><td>Zip支持：</td><td>{$sys_info.zip}</td></tr>
                <tr><td>Zlib支持：</td><td>{$sys_info.zlib}</td></tr>
                </tbody>
              </table>
              </div>
            </div>
        </div>
    </div>
</div>
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>
{include file="public/footer"/}
<script>
  	function check_upgrade_version(){
  		$.ajax({
  			  type : "POST",
  			  url  : "{:url('/update/check')}",
  			  dataType : "JSON",
  			  success: function(res) {
    				if (1 == res.code) {
    				  if (2 == res.data.code) {
    					  $('#upgrade_filelist').html(res.data.msg.upgrade);
    					  $('#upgrade_intro').html(res.data.msg.intro);
    					  $('#upgrade_notice').html(res.data.msg.notice);
    					  $('#a_upgrade').attr('data-version', res.data.msg.key_num)
    					  .attr('data-max_version', res.data.msg.max_version)
    					  .attr('title', res.data.msg.tips);
    					  $('#a_upgrade').html('检测到新版本'+res.data.msg.key_num+'[点击查看]').css('color', '#F00');
    					  {if ($web_show_popup_upgrade == 1)}
    						  btn_upgrade($("#a_upgrade"), 1);
    					  {/if}
    				  } else {
    					  $('#td_upgrade_msg').html(res.msg);
    				  }
    				}else{
               $('#td_upgrade_msg').html(res.msg);
            }
  			  }
  		  }); 
  	};
	
    layui.use(['layer', 'table', 'admin'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var table = layui.table;
        var admin = layui.admin;
        $.get("{:url('/ajax/welcome_handle')}"); // 进入欢迎页面需要异步处理的业务
        // 新增快捷导航
        $('#quickMenuAdd').click(function(){
            var iframes = parent.layer.open({
                type: 2,
                title: '快捷导航管理',
                fixed: true, //不固定
                shadeClose: false,
                shade: 0.3,
                area: ['550px', '400px'],
                content: "{:url('/index/ajax_quickmenu')}"
            });
        });
        $(document).on("click","#check_authortoken",function(){
            parent.layer.prompt({title:'输入授权码',formType: 1},
              function(val, index){
                var domain = "{$Request.host}";
                
                $.ajax({
                    url: "http://www.pcfcms.com/api.php/ajax/ajax_shouquan.html",
                    type: 'POST',
                    dataType: 'JSON',
                    data: {pass:val,domian:domain},
                    success: function(res){
                        if (res.code == 1) {
                            layer.msg(res.msg, {icon: 1, time: 2000}, function(){
                                $.post("{:url('/index/ajax_sq')}");
                                parent.top.window.location.reload();
                            });
                        }else{
                            parent.layer.msg(res.msg, {icon: 2, time: 2000});
                        }
                    },
                    error: function(e){
                        parent.layer.msg("未知错误，操作中断！", {icon:2, time:1000});
                    }
                });
                parent.layer.close(index);
              }
          );
        });
		    check_upgrade_version();
    });
	

</script>
</body>
</html>